﻿<%@ Page Title="文章" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EditArticle.aspx.cs" Inherits="Manage_NewArticle" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <%if (!Page.User.Identity.IsAuthenticated)
      {
          Response.Redirect("~/Manage/Default.aspx");
      }
    %>
    <style type="text/css">
        table tr
        {
            height: 35px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:ValidationSummary ID="ArticleValidationSummary" runat="server" 
        CssClass="failureNotification" ValidationGroup="ArticleValidationGroup" />
    <asp:HiddenField ID="ArticleID" runat="server" />
    <table width="100%">
        <tr>
            <td style="width:100px;" align="right">文章标题：</td>
            <td><asp:TextBox ID="ArticleTitle" runat="server" Width="300px" />
                <asp:RequiredFieldValidator ID="TitleRequired" runat="server" 
                    ControlToValidate="ArticleTitle" CssClass="failureNotification" 
                    ErrorMessage="请输入文章标题。" ToolTip="请输入文章标题。" 
                    ValidationGroup="ArticleValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">文章小标题：</td>
            <td><asp:TextBox ID="Subtitle" runat="server" Width="300px"/>
                <asp:RequiredFieldValidator ID="SubtitleRequired" runat="server" 
                    ControlToValidate="Subtitle" CssClass="failureNotification" 
                    ErrorMessage="请输入文章小标题。" ToolTip="请输入文章小标题。" 
                    ValidationGroup="ArticleValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">关键字：</td>
            <td><asp:TextBox ID="Keywords" runat="server" Width="300px"/></td>
        </tr>
        <tr>
            <td align="right">发表时间：</td>
            <td><asp:TextBox ID="Published" runat="server" Width="300px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="PublishedRequired" runat="server" 
                    ControlToValidate="Published" CssClass="failureNotification" 
                    ErrorMessage="请输入发表时间。" ToolTip="请输入发表时间。" 
                    ValidationGroup="ArticleValidationGroup">*</asp:RequiredFieldValidator>
            &nbsp;例如：2012/05/01 09:22:10</td>
        </tr>
        <tr>
            <td align="right">所属栏目：</td>
            <td><asp:DropDownList ID="ForumList" runat="server" DataSourceID="ForumDataSource" 
                    DataTextField="Name" DataValueField="ID" />
                <asp:LinqDataSource ID="ForumDataSource" runat="server" 
                    ContextTypeName="TreasurerDataContext" EntityTypeName="" 
                    Select="new (Name, ID)" TableName="Forums">
                </asp:LinqDataSource>
            </td>
        </tr>
        <tr>
            <td align="right">文章内容：</td>
            <td><CKEditor:CKEditorControl ID="Body" runat="server" 
                    FilebrowserBrowseUrl="../ckfinder/ckfinder.html" 
                    FilebrowserFlashBrowseUrl="../ckfinder/ckfinder.html?Type=Flash" 
                    FilebrowserFlashUploadUrl="../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&amp;type=Flash" 
                    FilebrowserImageBrowseUrl="../ckfinder/ckfinder.html?Type=Images" 
                    FilebrowserImageUploadUrl="../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&amp;type=Images" 
                    FilebrowserUploadUrl="../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&amp;type=Files"></CKEditor:CKEditorControl></td>
        </tr>
        <tr>
            <td align="right">所用模版：</td>
            <td>
                <asp:RadioButtonList ID="TemplateList" runat="server" 
                    RepeatDirection="Horizontal"></asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center"><asp:Button ID="SaveButton" runat="server" 
                    onclick="SaveButton_Click" style="width: 40px" 
                    ValidationGroup="ArticleValidationGroup" Text="保存"/></td>
        </tr>
    </table>
</asp:Content>

